class: center, middle, inverse, title-slide # World Renewable Energy Consumption ## For Europe, the UK, the US, Canada, and China ### Loren, Owen, and Jackie ### Bates College ### 2022-04-07 --- ```r cleandata <- alldata %>% filter(country %in% c("United States", "Canada", "United Kingdom", "Spain", "France", "Germany", "Switzerland", "Italy", "Norway", "Sweden", "Finland", "China", "Brazil", "India", "Russia", "Japan", "New Zealand", "Australia", "Africa", "South Africa"), year >= 1990) %>% select(country, year, wind_energy_per_capita, wind_consumption, wind_share_energy, wind_cons_change_twh, gdp, solar_energy_per_capita, solar_consumption, solar_share_energy, solar_cons_change_twh, renewables_energy_per_capita, renewables_consumption, renewables_cons_change_twh, renewables_share_energy, population, nuclear_consumption, nuclear_share_energy, nuclear_cons_change_twh, nuclear_energy_per_capita, hydro_share_energy, hydro_cons_change_twh, hydro_energy_per_capita, hydro_consumption, fossil_cons_change_twh, fossil_fuel_consumption, fossil_energy_per_capita, fossil_share_energy, energy_cons_change_twh, energy_per_gdp, energy_per_capita, biofuel_cons_change_twh, biofuel_share_energy, biofuel_cons_per_capita, biofuel_consumption) #use this data for line plots etc (more consolidated country list) ``` ```r style_xaringan( title_slide_background_image = "img/confetti.jpg" ) ``` class: center, middle, testing ## A statement of the overall goal / research question --- class: inverse, center, middle # Section title --- # Hello World - Click the `Knit` button to compile your presentation - Make sure to commit and push all resulting files to your GitHub repo --- class: inverse, middle, center # Using xaringan --- # xaringan - The presentation is created using the `xaringan` package - Use `---` to separate slides and `--` for incremental builds -- - Like this --- # Layouts You can use plain text - or bullet points .pull-left[ or text in two columns `\(^*\)` ] .pull-right[ - like - this ] .footnote[ [*] And add footnotes ] --- # Code <<<<<<< HEAD ======= ```r leaflettdata <- alldata %>% filter(year >= 1990) %>% select(country, year, wind_energy_per_capita, wind_consumption, wind_share_energy, wind_cons_change_twh, gdp, solar_energy_per_capita, solar_consumption, solar_share_energy, solar_cons_change_twh, renewables_energy_per_capita, renewables_consumption, renewables_cons_change_twh, renewables_share_energy, population, nuclear_consumption, nuclear_share_energy, nuclear_cons_change_twh, nuclear_energy_per_capita, hydro_share_energy, hydro_cons_change_twh, hydro_energy_per_capita, hydro_consumption, fossil_cons_change_twh, fossil_fuel_consumption, fossil_energy_per_capita, fossil_share_energy, energy_cons_change_twh, energy_per_gdp, energy_per_capita, biofuel_cons_change_twh, biofuel_share_energy, biofuel_cons_per_capita, biofuel_consumption) #use this data for leaflets - uses all countries ``` ```r testleaflet <- leaflettdata %>% filter(year == "2018") ``` <<<<<<< HEAD ======= >>>>>>> cbbca28058ca4500147374ecc8fb8bf0ae1500ce ```r testleaflet <- testleaflet %>% left_join(world_spdf2, by = c("country" = "NAME")) %>% st_as_sf() ``` ```r #2018 leaflet pal2 <- colorNumeric(palette = "RdYlGn", domain = testleaflet$renewables_share_energy) labels <- sprintf("<strong>%s</strong><br/>%s ", testleaflet$country, testleaflet$renewables_share_energy) %>% lapply(htmltools::HTML) m <- leaflet(data = testleaflet) %>% addTiles() %>% setView( lat=10, lng=0 , zoom=1) %>% addPolygons(fillColor = ~pal2(testleaflet$renewables_share_energy), fillOpacity = 1, color = "white", opacity = 0.7, weight = 1, label = labels) %>% addLegend("bottomright", pal = pal2, values = ~testleaflet$renewables_share_energy, title = "2018 Renewable<br> Energy Share", opacity = 1) m ``` <<<<<<< HEAD
=======
>>>>>>> cbbca28058ca4500147374ecc8fb8bf0ae1500ce >>>>>>> 5a27573c0ae598542ebacc638267bc616294156c ---
--- <<<<<<< HEAD ======= <<<<<<< HEAD
=======
>>>>>>> cbbca28058ca4500147374ecc8fb8bf0ae1500ce >>>>>>> 5a27573c0ae598542ebacc638267bc616294156c
---
======= <<<<<<< HEAD
=======
>>>>>>> cbbca28058ca4500147374ecc8fb8bf0ae1500ce >>>>>>> 5a27573c0ae598542ebacc638267bc616294156c --- # Plots ``` ## [1] "country" "year" "overall_consumption" ## [4] "energy_type" "consumption" ``` --- <img src="presentation_files/figure-html/barchart-transformed-fig-1.png" width="80%" /> --- <img src="presentation_files/figure-html/china-usa-bar-1.png" width="80%" /> ``` <<<<<<< HEAD ======= <<<<<<< HEAD
=======
>>>>>>> cbbca28058ca4500147374ecc8fb8bf0ae1500ce >>>>>>> 5a27573c0ae598542ebacc638267bc616294156c ```r # leaflettdata <- leaflettdata %>% # left_join(world_spdf2, by = c("country" = "NAME")) %>% #st_as_sf() ``` <<<<<<< HEAD ======= >>>>>>> cbbca28058ca4500147374ecc8fb8bf0ae1500ce <img src="presentation_files/figure-html/plot-iris-1.png" width="80%" /> --- ## Plot and text .pull-left[ - Some text - goes here ] .pull-right[ ] --- # Tables If you want to generate a table, make sure it is in the HTML format (instead of Markdown or other formats), e.g., <table> <thead> <tr> <th style="text-align:right;"> Sepal.Length </th> <th style="text-align:right;"> Sepal.Width </th> <th style="text-align:right;"> Petal.Length </th> <th style="text-align:right;"> Petal.Width </th> <th style="text-align:left;"> Species </th> </tr> </thead> <tbody> <tr> <td style="text-align:right;"> 5.1 </td> <td style="text-align:right;"> 3.5 </td> <td style="text-align:right;"> 1.4 </td> <td style="text-align:right;"> 0.2 </td> <td style="text-align:left;"> setosa </td> </tr> <tr> <td style="text-align:right;"> 4.9 </td> <td style="text-align:right;"> 3.0 </td> <td style="text-align:right;"> 1.4 </td> <td style="text-align:right;"> 0.2 </td> <td style="text-align:left;"> setosa </td> </tr> <tr> <td style="text-align:right;"> 4.7 </td> <td style="text-align:right;"> 3.2 </td> <td style="text-align:right;"> 1.3 </td> <td style="text-align:right;"> 0.2 </td> <td style="text-align:left;"> setosa </td> </tr> <tr> <td style="text-align:right;"> 4.6 </td> <td style="text-align:right;"> 3.1 </td> <td style="text-align:right;"> 1.5 </td> <td style="text-align:right;"> 0.2 </td> <td style="text-align:left;"> setosa </td> </tr> <tr> <td style="text-align:right;"> 5.0 </td> <td style="text-align:right;"> 3.6 </td> <td style="text-align:right;"> 1.4 </td> <td style="text-align:right;"> 0.2 </td> <td style="text-align:left;"> setosa </td> </tr> <tr> <td style="text-align:right;"> 5.4 </td> <td style="text-align:right;"> 3.9 </td> <td style="text-align:right;"> 1.7 </td> <td style="text-align:right;"> 0.4 </td> <td style="text-align:left;"> setosa </td> </tr> </tbody> </table> --- # Images <div class="figure" style="text-align: center"> <img src="https://images.unsplash.com/photo-1535448033526-c0e85c9e6968?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1650&q=80" alt="Image credit: Photo by Jörg Angeli on Unsplash." width="60%" /> <p class="caption">Image credit: Photo by Jörg Angeli on Unsplash.</p> </div> Or you can also include a full page image. See next slide. --- background-image: url(https://images.unsplash.com/photo-1535448033526-c0e85c9e6968?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1650&q=80) --- # Math Expressions You can write LaTeX math expressions inside a pair of dollar signs, e.g. $\alpha+\beta$ renders `\(\alpha+\beta\)`. You can use the display style with double dollar signs: ``` `$$\bar{X}=\frac{1}{n}\sum_{i=1}^nX_i$$` ``` `$$\bar{X}=\frac{1}{n}\sum_{i=1}^nX_i$$` Limitations: 1. The source code of a LaTeX math expression must be in one line, unless it is inside a pair of double dollar signs, in which case the starting `$$` must appear in the very beginning of a line, followed immediately by a non-space character, and the ending `$$` must be at the end of a line, led by a non-space character; 1. There should not be spaces after the opening `$` or before the closing `$`. 1. Math does not work on the title slide (see [#61](https://github.com/yihui/xaringan/issues/61) for a workaround). --- # Feeling adventurous? - Want to find out more about `xaringan`? See https://slides.yihui.name/xaringan/#1. - You are welcomed to use the default styling of the slides. In fact, that's what I expect majority of you will do. You will differentiate yourself with the content of your presentation. - But some of you might want to play around with slide styling. The `xaringanthemer` provides some solutions for this that: https://pkg.garrickadenbuie.com/xaringanthemer. - And if you want more bells and whistles, there is also `xaringanExtra`: https://pkg.garrickadenbuie.com/xaringanExtra.